#!/usr/bin/env bash

for LAST_FIELD in 150 151 152 153 156 158
do
    echo
done
cat > /etc/sysconfig/network-scripts/ifcfg-eth1 <<EOF
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.20.150
NETMASK=255.255.255.0
GATEWAY=192.168.20.1
EOF

sed -i 's#HOSTNAME=.*#HOSTNAME=lb01.lavenliu.com#g' /etc/sysconfig/network
/bin/hostname `awk -F\= '/HOST/ { print $2 }' /etc/sysconfig/network`
